package com.scalar.forecast.salesForecastEntry;

import org.apache.struts.util.LabelValueBean;

import java.util.ArrayList;

/**
 * User: Sujan
 * Date: Jul 13, 2005
 * Time: 7:30:00 PM
 */
public class SlotData
{
    private int rowId;
    private int month;
    private int year;
    private int qty;
    private double price;
    private double confidenceLevel;
    private double runningTotal; //indicates the slot( month-year ) total.
    private ArrayList<LabelValueBean> confLevelOptions;
    private boolean readOnly;
    private int qtr;
    private int blQty;
    private double blPrice;
    private int acQty;
    private double acPrice;
    private String key;

	//following properties are used for ikanos
	private double royalty;
	private double rebate;
	private double materialCost;
	private double portVolume;

    public SlotData()
    {
        rowId   = -1;
        month   = -1;
        year    = -1;
        qty     = 0;
        price   = 0.0d;
        confidenceLevel = 0.0d;
        readOnly = false;

        confLevelOptions = new ArrayList<LabelValueBean>();
        confLevelOptions.add ( new LabelValueBean ( "0%--Lead", "0.0" ) );
        confLevelOptions.add ( new LabelValueBean ( "25%--Qualified", "25.0" ) );
        confLevelOptions.add ( new LabelValueBean ( "50%--Pend Design Win", "50.0" ) );
        confLevelOptions.add ( new LabelValueBean ( "75%--Design Win", "75.0" ) );
        confLevelOptions.add ( new LabelValueBean ( "90%--Production", "90.0" ) );
        confLevelOptions.add ( new LabelValueBean ( "100%--Mass Prod", "100.0" ) );
    }

    public int getRowId()
    {
        return rowId;
    }

    public void setRowId(int rowId)
    {
        this.rowId = rowId;
    }

    public int getMonth()
    {
        return month;
    }

    public void setMonth(int month)
    {
        this.month = month;
    }

    public int getYear()
    {
        return year;
    }

    public void setYear(int year)
    {
        this.year = year;
    }

    public int getQty()
    {
        return qty;
    }

    public void setQty(int qty)
    {
        this.qty = qty;
    }

    public double getPrice()
    {
        return price;
    }

    public void setPrice(double price)
    {
        this.price = price;
    }

    public double getConfidenceLevel()
    {
        return confidenceLevel;
    }

    public void setConfidenceLevel(double confidenceLevel)
    {
        this.confidenceLevel = confidenceLevel;
    }

    public double getRunningTotal()
    {
        return runningTotal;
    }

    public void setRunningTotal(double runningTotal)
    {
        this.runningTotal = runningTotal;
    }

    public String getConfLevelDisplayValue ()
    {
        int confLevelOptionsSize = ( confLevelOptions == null ) ? 0 : confLevelOptions.size();
        LabelValueBean option    = null;
        for ( int i = 0; i < confLevelOptionsSize; i++ )
        {
            option = ( LabelValueBean ) confLevelOptions.get ( i );
            if ( confidenceLevel == Double.parseDouble ( option.getValue() ) )
            {
                return option.getLabel();
            }
        }
        return "";
    }
    public ArrayList<LabelValueBean> getConfLevelOptions ()
    {
        return confLevelOptions;
    }

    public boolean isReadOnly()
    {
        return readOnly;
    }

    public void setReadOnly(boolean readOnly)
    {
        this.readOnly = readOnly;
    }

    public int getQtr() {
        return qtr;
    }

    public void setQtr(int qtr) {
        this.qtr = qtr;
    }

    public int getBlQty() {
        return blQty;
    }

    public void setBlQty(int blQty) {
        this.blQty = blQty;
    }

    public double getBlPrice() {
        return blPrice;
    }

    public void setBlPrice(double blPrice) {
        this.blPrice = blPrice;
    }

    public int getAcQty() {
        return acQty;
    }

    public void setAcQty(int acQty) {
        this.acQty = acQty;
    }

    public double getAcPrice() {
        return acPrice;
    }

    public void setAcPrice(double acPrice) {
        this.acPrice = acPrice;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

	public double getRoyalty() {
		return royalty;
	}

	public void setRoyalty(double royalty) {
		this.royalty = royalty;
	}

	public double getRebate() {
		return rebate;
	}

	public void setRebate(double rebate) {
		this.rebate = rebate;
	}

	public double getMaterialCost() {
		return materialCost;
	}

	public void setMaterialCost(double materialCost) {
		this.materialCost = materialCost;
	}

	public double getPortVolume() {
		return portVolume;
	}

	public void setPortVolume(double portVolume) {
		this.portVolume = portVolume;
	}
}

